package com.ruoyi.system.mapper;

import java.util.List;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.system.domain.WeatherForecast;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

/**
 * 天气预报Mapper接口
 *
 * @author ruoyi
 * @date 2025-03-16
 */
@Mapper
public interface WeatherForecastMapper
{
    /**
     * 查询天气预报
     *
     * @param id 天气预报主键
     * @return 天气预报
     */
    public WeatherForecast selectWeatherForecastById(Long id);

    /**
     * 查询天气预报列表
     *
     * @param weatherForecast 天气预报
     * @return 天气预报集合
     */
    public List<WeatherForecast> selectWeatherForecastList(WeatherForecast weatherForecast);

    /**
     * 新增天气预报
     *
     * @param weatherForecast 天气预报
     * @return 结果
     */
    public int insertWeatherForecast(WeatherForecast weatherForecast);

    /**
     * 修改天气预报
     *
     * @param weatherForecast 天气预报
     * @return 结果
     */
    public int updateWeatherForecast(WeatherForecast weatherForecast);

    /**
     * 删除天气预报
     *
     * @param id 天气预报主键
     * @return 结果
     */
    public int deleteWeatherForecastById(Long id);

    /**
     * 批量删除天气预报
     *
     * @param ids 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteWeatherForecastByIds(String[] ids);


    @Select("select * from weather_forecast where date =#{date}")
    WeatherForecast selectWeatherForecastByDate(String date);


//    @Select("select * from weather_forecast where date between CURDATE() and DATE_ADD(CURRENT_DATE, INTERVAL 6 DAY)")
    List<WeatherForecast> getWeatherForecastSeven();
}
